package com.zbkj.crmeb.chant.request;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class DistributionRequest implements Serializable {

    @ApiModelProperty(value = "分销模式（1人人分销  2指定订单数分销  3指定金额分销）")
    @NotNull(message = "分销模式不能为空")
    @Range(min = 1, max = 3, message = "请选择正确的类型")
    private Integer model;

    @ApiModelProperty(value = "适用商品（1全部商品, 2指定条件, 3指定商品）")
    private Integer applyType;

    @ApiModelProperty(value = "指定条件（json对象: 分类, 品牌, 发货地, 季节）")
    private JSONObject specifyConditions;

    @ApiModelProperty(value = "指定商品")
    private String specifyGoods;

    @ApiModelProperty(value = "达成条件（金额/订单数）")
    private BigDecimal condition;

    @ApiModelProperty(value = "一级返佣比例")
    @NotNull(message = "一级返佣比例不能为空")
    private BigDecimal oneRebateRate;

    @ApiModelProperty(value = "二级返佣比例")
    @NotNull(message = "一级返佣比例不能为空")
    private BigDecimal twoRebateRate;

    @ApiModelProperty(value = "团长兜底返佣比例")
    private BigDecimal baseRebateRate;

    @ApiModelProperty(value = "提现最低金额")
    private BigDecimal minPrice;

}